package com.ycsj.goldmedalnewconcept.teacher.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.ycsj.common.base.CommonAdapter;
import com.ycsj.common.base.ViewHolder;
import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.teacher.bean.TkInputInfo;

import java.util.List;

/**
 * 展示自己选择的答案和正确答案的通用适配器
 * Created by Administrator on 2018/9/10 0010.
 */

public class LvSelfAnswerAdapter extends CommonAdapter<TkInputInfo> {
    public LvSelfAnswerAdapter(Context context, List<TkInputInfo> datas, int layoutId) {
        super(context, datas, layoutId);
    }

    @Override
    public void convert(ViewHolder holder, TkInputInfo tkInputInfo) {
        //标号
        TextView tv_index = holder.getView(R.id.tv_index);
        if (!TextUtils.isEmpty(tkInputInfo.index)) {
            tv_index.setVisibility(View.VISIBLE);
            tv_index.setText(tkInputInfo.index);
        } else {
            tv_index.setVisibility(View.GONE);
        }
        //答案
        TextView tv_answer = holder.getView(R.id.tv_answer);
        tv_answer.setText(tkInputInfo.content);
    }
}
